package com.example.tian.securityinspection.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.tian.securityinspection.model.bean.TestBean;
import com.example.tian.securityinspection.model.bean.genBean.Fruit;
import com.example.tian.securityinspection.model.bean.genBean.Test2;

import com.example.tian.securityinspection.gen.TestBeanDao;
import com.example.tian.securityinspection.gen.FruitDao;
import com.example.tian.securityinspection.gen.Test2Dao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig testBeanDaoConfig;
    private final DaoConfig fruitDaoConfig;
    private final DaoConfig test2DaoConfig;

    private final TestBeanDao testBeanDao;
    private final FruitDao fruitDao;
    private final Test2Dao test2Dao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        testBeanDaoConfig = daoConfigMap.get(TestBeanDao.class).clone();
        testBeanDaoConfig.initIdentityScope(type);

        fruitDaoConfig = daoConfigMap.get(FruitDao.class).clone();
        fruitDaoConfig.initIdentityScope(type);

        test2DaoConfig = daoConfigMap.get(Test2Dao.class).clone();
        test2DaoConfig.initIdentityScope(type);

        testBeanDao = new TestBeanDao(testBeanDaoConfig, this);
        fruitDao = new FruitDao(fruitDaoConfig, this);
        test2Dao = new Test2Dao(test2DaoConfig, this);

        registerDao(TestBean.class, testBeanDao);
        registerDao(Fruit.class, fruitDao);
        registerDao(Test2.class, test2Dao);
    }
    
    public void clear() {
        testBeanDaoConfig.clearIdentityScope();
        fruitDaoConfig.clearIdentityScope();
        test2DaoConfig.clearIdentityScope();
    }

    public TestBeanDao getTestBeanDao() {
        return testBeanDao;
    }

    public FruitDao getFruitDao() {
        return fruitDao;
    }

    public Test2Dao getTest2Dao() {
        return test2Dao;
    }

}
